<?php

declare(strict_types=1);
/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://hyperf.wiki
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
 */
namespace App\Controller\User;

use App\Ability\ApiResponse;
use App\Controller\AbstractController;
use App\Rpc\UserProfileServiceInterface;
use Hyperf\Context\Context;
use Hyperf\HttpServer\Contract\RequestInterface;

class InfoController extends AbstractController
{
    use ApiResponse;

    /**
     * 用户资料查询
     * @param RequestInterface $request
     * @return array
     */
    public function profile(RequestInterface $request)
    {
        $user_id = Context::get("user_id",999);
        $result = make(UserProfileServiceInterface::class)->getUserInfoById($user_id);
        return $result;
    }
}
